<template>
  <img :style="{width:showAll  ? '100%' : '48%',height:showAll  ? '100%' : '48%'}" :src="imageUrl" @click="goDetail"/>
</template>

<script setup>
import {computed} from "vue";
import router from "@/router";

const props = defineProps({
  name: {
    type: String,
  },
  showAll: {
    type: Boolean,
    default: false
  }
})

const imageUrl = computed(() => {
  return require(`../assets/${props.name}.png`)
})

const goDetail = () => {
  router.push({name: 'helpInfo', query: {name: props.name}})
}

</script>

<style lang="scss" scoped>

</style>
